package top.hjcwzx.domain.test.service.tree.factory;

import lombok.*;
import org.springframework.stereotype.Service;
import top.hjcwzx.domain.test.model.tree.TreeReq;
import top.hjcwzx.domain.test.model.tree.TreeRes;
import top.hjcwzx.domain.test.service.tree.node.RootNode;
import top.hjcwzx.types.design.framework.tree.StrategyHandler;

/**
 * {@code @author} hujincheng <br/>
 * {@code @description} DefaultTreeTestFactory <br/>
 * {@code @create} 2025-04-01 10:46 <br/>
 */
@Service
@RequiredArgsConstructor
public class DefaultTreeTestFactory {

    private final RootNode rootNode;

    /**
     * 开启策略
     * @return 策略处理器 - 默认由根节点流经动态配置的节点
     */
    public StrategyHandler<TreeReq, DynamicContext, TreeRes> strategyHandler() {
        return rootNode;
    }


    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    @Builder
    public static class DynamicContext {
        private String field;
    }
}
